<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>用户列表</title>
  <link rel="stylesheet" href="../assets/lib/layui/css/layui.css">
  <style>
    body {
      height: 100%;
      margin: 20px;
      background-color: #eee;
    }

    body .layui-layer-rim {
      border: 0;
      box-shadow: 1px 1px 50px rgba(0, 0, 0, .3);
    }

    .pwform {
      margin-right: 40px;
      margin-top: 20px;
    }
  </style>
</head>

<body>
  <div class="layui-card">
    <div class="layui-card-header">用户列表</div>
    <div class="layui-card-body">
      <table class="layui-table">
        <colgroup>
          <col width="10%">
          <col width="20%">
          <col width="20%">
          <col width="20%">
          <col width="30%">
        </colgroup>
        <thead>
          <tr>
            <th>ID</th>
            <th>账号名称</th>
            <th>昵称</th>
            <th>邮箱</th>
            <th>操作</th>
          </tr>
        </thead>
        <tbody>
          <!-- 模板引擎渲染列表 -->
        </tbody>

      </table>
      <table id="demo" lay-filter="test"></table>
    </div>
  </div>
  <script type="text/html" id="tr">
    {{each data}}
    <tr>
      <td>{{$value.id}}</td>
      <td>{{$value.username}}</td>
      <td>{{$value.nickname}}</td>
      <td>{{$value.email}}</td>
      <td>
        <a href="./edit.html?id={{$value.id}}" class="layui-btn layui-btn-xs">编辑</a>
        <button type="button" class="layui-btn layui-btn-danger layui-btn-xs dele" data-id={{$value.id}}>删除</button>
        <button type="button" class="layui-btn layui-btn-normal layui-btn-xs reset" data-id={{$value.id}}>重置密码</button>
      </td>
    </tr>
    {{/each}}
  </script>
  <script type="text/html" id="pw">
    <form class="layui-form pwform" action="" lay-filter="abc" id="pwform">
      <div class="layui-form-item">
        <label class="layui-form-label">密码</label>
        <div class="layui-input-block">
          <input type="password" name="password" required lay-verify="required|pwd" placeholder="请输入密码"
            autocomplete="off" class="layui-input">
        </div>
      </div>
      <div class="layui-form-item">
        <label class="layui-form-label">确认密码</label>
        <div class="layui-input-block">
          <input type="password" required lay-verify="required|pwd|repeatpwd" placeholder="请再次输入密码" autocomplete="off"
            class="layui-input">
        </div>
      </div>
      <div class="layui-form-item">
        <div class="layui-input-block">
          <input type="hidden" , name="id" value="">
          <button class="layui-btn" lay-submit lay-filter="formDemo" id="submit">提交</button>
          <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
      </div>
    </form>
  </script>
  <script src="../assets/lib/jquery.js"></script>
  <script src="../assets/lib/layui/layui.all.js"></script>
  <script src="../assets/lib/template-web.js"></script>
  <script src="../assets/js/common.js"></script>
  <script src="../assets/js/user/user.js"></script>
</body>

</html>